﻿Public Class frmSocio

    Dim validar As New Validations

    Private Sub frmSocio_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        'TODO: esta línea de código carga datos en la tabla 'TPI_PAVDataSet.club' Puede moverla o quitarla según sea necesario.
        Me.ClubTableAdapter.Fill(Me.TPI_PAVDataSet.club)


    End Sub

    Private Sub btnSalir_Click(sender As System.Object, e As System.EventArgs) Handles btnSalir.Click
        Dim Respuesta As Integer = MessageBox.Show("¿Esta seguro que quiere salir?", "Confirmar", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)
        If Respuesta = 1 Then
            End
        End If
    End Sub

    Private Sub btnAgregarImagen_Click(sender As System.Object, e As System.EventArgs) Handles btnAgregarImagen.Click
        Me.openImage.ShowDialog()
    End Sub

    Private Sub btnNuevo_Click(sender As System.Object, e As System.EventArgs) Handles btnNuevo.Click
        habilitaLabels(True)
    End Sub

    Private Sub habilitaLabels(ByVal param As Boolean)

        Me.txtApellido.Enabled = param
        Me.txtNombre.Enabled = param
        Me.txtNroDoc.Enabled = param
        Me.cmbTipoDoc.Enabled = param
        Me.dtpFechaNac.Enabled = param
        Me.txtCalle.Enabled = param
        Me.txtNro.Enabled = param
        Me.txtPiso.Enabled = param
        Me.txtDpto.Enabled = param
        Me.txtCodPostal.Enabled = param
        Me.cmbClub.Enabled = param
        Me.ckbEsJugador.Enabled = param
        Me.dtpFechaAlta.Enabled = param
        Me.btnAgregarImagen.Enabled = param
        Me.btnGuardar.Enabled = param
        Me.btnCancelar.Enabled = param

        validar.resetTextBox(Me)


    End Sub
End Class